package com.bawei.websocketdemo

import android.app.Service
import android.content.Intent
import android.os.IBinder
import android.util.Log

class MyService : Service() {

    override fun onBind(intent: Intent): IBinder {
        TODO("Return the communication channel to the service.")
    }

    override fun onCreate() {
        super.onCreate()
        Thread{
            while (true){
                Thread.sleep(1000)
                Log.d("ytx", "onCreate: ")
            }
        }.start()
    }


    override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
        Thread{
            while (true){
                Thread.sleep(1000)
                Log.d("ytx", "onStartCommand: ")
            }
        }.start()
        return START_STICKY
    }

}